<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改产品信息（下游/甲方）')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-info-edit" th:object="${productInfo}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">产品名称：</label>
                <div class="col-sm-8">
                    <input name="productName" th:field="*{productName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">logo地址：</label>
                <div class="col-sm-8">
                    <img alt="[ 产品logo ]" width="90px" height="60px"  src="" id="logoUrl_img" th:src="*{logoUrl}">
                    <input name="logoUrl" id="logoUrl" class="form-control" type="hidden" required>
                    <input id="inputImage" name="file" type="file" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">产品描述：</label>
                <div class="col-sm-8">
                    <input name="descInfo" th:field="*{descInfo}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">产品详情地址：</label>
                <div class="col-sm-8">
                    <input name="detailUrl" th:field="*{detailUrl}" class="form-control" type="text" required>
                </div>
            </div>

<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label is-required">渠道类型：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select name="productType"  class="form-control">-->
<!--                        <option  th:each="item:${channelTypeList}" th:text="${item.name}" th:value="${item.productType}"></option>-->
<!--                    </select>-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">排序权重：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="sortWeight" th:field="*{sortWeight}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">申请人数：</label>
                <div class="col-sm-8">
                    <input name="applyNumber" th:field="*{applyNumber}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">产品标签：</label>
                <div class="col-sm-8">
                    <input name="productLabel" th:field="*{productLabel}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最大贷款额度：</label>
                <div class="col-sm-8">
                    <input name="maxLoanAmount" th:field="*{maxLoanAmount}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最小贷款额度：</label>
                <div class="col-sm-8">
                    <input name="minLoanAmount" th:field="*{minLoanAmount}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">贷款利率：</label>
                <div class="col-sm-8">
                    <input name="interestRate" th:field="*{interestRate}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最大贷款周期：</label>
                <div class="col-sm-8">
                    <input name="maxLoanPeriod" th:field="*{maxLoanPeriod}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最小贷款周期：</label>
                <div class="col-sm-8">
                    <input name="minLoanPeriod" th:field="*{minLoanPeriod}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">产品价格：</label>
                <div class="col-sm-8">
                    <input name="priceAmount" th:field="*{priceAmount}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">产品类型：</label>
                <div class="col-sm-8">
                    <select class="form-control"  th:field="*{type}" name="type">
                        <option value="">所有</option>
                        <option th:each="item:${prodTypeList}" th:value="${item.value}" th:text="${item.name}"></option>
                    </select>
                </div>
            </div>
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">排序权重：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="sortWeight"  th:field="*{sortWeight}" class="form-control" type="text">-->
<!--                    <span style="color: red">值越大排的越靠前</span>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">价格类型：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select class="form-control"  th:field="*{priceType}"  name="priceType">-->
<!--                        <option value="1">UV计价</option>-->
<!--                        <option value="2">注册计价</option>-->
<!--                    </select>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">联登产品展示时长：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="unionShowHours" th:field="*{unionShowHours}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">A后台地址：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="adminUrl" th:field="*{adminUrl}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">A后台账号：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="adminAccount" th:field="*{adminAccount}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">A后台密码：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="adminPasswd" th:field="*{adminPasswd}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">联登收益价：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="unionProfitPrice" th:field="*{unionProfitPrice}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">是否联登产品：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <label class="toggle-switch switch-solid">-->
<!--                        <input type="checkbox" name="unionLoginFlagStr" th:checked="*{unionProfitPrice}"> <span></span>-->
<!--                    </label>-->
<!--                </div>-->
<!--            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <script th:inline="javascript">
        var prefix = ctx + "product/info";
        $("#form-info-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-info-edit').serialize());
            }
        }

        $(document).ready(function () {
            // 单图上传
            $("#inputImage").fileinput({
                uploadUrl: ctx + 'common/upload/product',
                maxFileCount: 1,
                autoReplace: true
            }).on('fileuploaded', function (event, data, previewId, index) {
                var rsp = data.response;
                $("#logoUrl").val(rsp.fileUrl)
                $("#logoUrl_img").attr("src", rsp.fileUrl)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })
        });



    </script>
</body>
</html>